YZYZ.Curtain = {};
YZYZ.Curtain.box = null;
YZYZ.Curtain.createMsg = function(_msg) {
	return ['<div class="divCommonCurtainMsg">',
	    '<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
	    '<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>', _msg, '</h3></div></div></div>',
	    '<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
	    '</div>'].join('');
};
YZYZ.Curtain.createAlert = function(_msg) {
	return ['<div class="divCommonCurtainAlert">',
	    '<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
	    '<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3><font class="alertFont">', _msg, '</font></h3></div></div></div>',
	    '<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
	    '</div>'].join('');
};
YZYZ.Curtain.msg = function(_msg) 
{
	if(_msg != "")
	{
		YZYZ.Curtain.msgWithTime(_msg, 4);
	}
};
YZYZ.Curtain.msgWithTime = function(_msg, _seconds) 
{
    if(!YZYZ.Curtain.box) {
        YZYZ.Curtain.box = Ext.DomHelper.insertFirst(document.body, 
        	{ id : 'divCurtainBox', style : 'position : absolute; z-index : 30000; width : 250px;' }, true);
    }
    YZYZ.Curtain.box.alignTo(document.body, 't-t');
    var m = Ext.DomHelper.append(YZYZ.Curtain.box, 
    	{ html : YZYZ.Curtain.createMsg(_msg) }, true);
    m.slideIn('t').pause(_seconds).slideOut('t', { remove : true });
};
YZYZ.Curtain.alertWithTime = function(_msg, _seconds) 
{
    if(!YZYZ.Curtain.box) {
        YZYZ.Curtain.box = Ext.DomHelper.insertFirst(document.body, 
        	{ id : 'divCurtainBox', style : 'position : absolute; z-index : 40000; width : 250px;' }, true);
    }
    YZYZ.Curtain.box.alignTo(document.body, 't-t');
    var m = Ext.DomHelper.append(YZYZ.Curtain.box, 
    	{ html : YZYZ.Curtain.createAlert(_msg) }, true);
    m.slideIn('t').pause(_seconds).slideOut('t', { remove : true });
};
YZYZ.Curtain.alert = function(_msg) 
{
	if(_msg != "")
	{
		YZYZ.Curtain.alertWithTime(_msg, 4);
	}
};